import { makeAutoObservable } from 'mobx';
import { Storage } from '@/utils/storage';

export const sysMapStore = makeAutoObservable({
  flawTypeStorage: {
    // layer存储的缺陷类型(综合map分析页)
    // doff: Storage.get('flawTypeLayerId') ? Storage.get('flawTypeLayerId').doff : ([] as Array<string | number>),
    pol: Storage.get('flawTypeLayerId') ? Storage.get('flawTypeLayerId').pol : ([] as Array<string | number>),
    piantiehou: Storage.get('flawTypeLayerId') ? Storage.get('flawTypeLayerId').piantiehou : ([] as Array<string | number>)
  },
  flawPosition: [],
  slitPosition: [],
  checkedFlawTypePmp: Storage.get('map_checkedFlawType') ? Storage.get('map_checkedFlawType').checkedFlawType : ([] as Array<number>), // 前制程选中的子缺陷集合
  // 改变选中的缺陷类型
  changeCheckedFlawType(classIdList: Array<number>) {
    this.checkedFlawTypePmp = classIdList;
  }
});

export default sysMapStore;
